Skip to content

Add an option to import/export Scrupdate configuration#6

Open
DanielKirshner wants to merge 1 commit into
MatanBright:mainfrom
DanielKirshner:danielk/import-export-config
Open

Add an option to import/export Scrupdate configuration#6
DanielKirshner wants to merge 1 commit into
MatanBright:mainfrom
DanielKirshner:danielk/import-export-config

Conversation

@DanielKirshner
Copy link
Copy Markdown

Resolves #2

What does this PR do?

This PR implements the requested configuration Import/Export functionality to allow users to easily backup, restore, or migrate their Scrupdate configurations across devices or after OS reinstalls.

Implementation details:

  • Configuration Utilities: Created ConfigurationImportExportUtilities.cs to handle bundling the application data. It securely zips and extracts both Settings.json and Programs.sqlite along with their .md5 checksum files into a unified .scrupdate archive format.
  • File Validation: During the import process, the archive is validated to ensure it contains matched configuration files and checksums to prevent corruption.
  • User Interface: Added "Export Configuration" and "Import Configuration" buttons to the 'General' tab in the SettingsWindow, matching the existing UI aesthetic. Confirmation and status dialogs guide the user through the process.
  • Safe State Handling: The actual configuration overwrite logic was purposefully handled in MainWindow.xaml.cs to ensure that the SQLite database and settings handler can be safely closed and disposed of before files are overwritten, preventing file lock exceptions. The application will immediately shut down after a successful import so the restored configurations perform cleanly on the next launch.

Testing:

  • Successfully exported .scrupdate archives holding customized user data.
  • Verified successful imports. The app cleanly shuts down, and upon restart, all imported configurations load properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add an option to import/export Scrupdate configuration

1 participant